#pragma once 

#include "Widget.h"
#include "Types.h"
#include <vector>

namespace My {

#pragma warning(push)
// Disable warning about inheritance via dominance
#pragma warning(disable:4250)

// StringContainer is a container that aligns its children in a line
class StringContainer : public virtual Widget, public virtual Container
{
public:
	typedef My::Size Size;
public:
	StringContainer();
public:
	Size GetSize() const
		{ return m_Children.size(); }
	Widget * GetChild(Size n) const
		{ return m_Children[n]; }
	int GetAlignment() const
		{ return m_Alignment; }
	int GetGap() const
		{ return m_Gap; }
	int GetBorderX() const
		{ return m_BorderX; }
	int GetBorderY() const
		{ return m_BorderY; }
	bool AreAllChildrenProvided() const;
public:
	void SetSize(Size s);
	void SetChild(Size n, Widget * pWidget);
	void AppendChild(Widget * pWidget);
	void SetAlignment(int a);
	void SetGap(int g);
	void SetBorderX(int b);
	void SetBorderY(int b);
public:
	// handlers
	virtual void LayoutControls();
	virtual CSize GetPreferredSize() const;
	virtual void HandleUpdateUI();
private:
	std::vector<Widget *>	m_Children;
	int						m_Alignment;
	int						m_Gap;
	int						m_BorderX;
	int						m_BorderY;
};

#pragma warning(pop)

} // My
